<template>
  <RouterView :key="route.path" />
  <van-tabbar v-model="active" route v-if="showBtmTab">
    <van-tabbar-item icon="home-o" to="/home/index">首页</van-tabbar-item>
    <van-tabbar-item icon="apps-o" to="/apps">分类</van-tabbar-item>
    <van-tabbar-item icon="shopping-cart-o" to="/shopping">购物车</van-tabbar-item>
    <van-tabbar-item icon="friends-o" to="/mine/index">我的</van-tabbar-item>
  </van-tabbar>
</template>

<script lang="ts">
import { ref, computed } from 'vue';
import { useRoute } from 'vue-router';
export default {
  name: "App",
  setup() {
    const active = ref(0);
    const route = useRoute();
    const showBtmTab = computed(() => route.meta.showBtmTab); // 使用 computed 计算属性来获取 showBtmTab
    return { active, showBtmTab, route };
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin: 0;
  padding: 0;
}

</style>